<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="http://localhost/RestEasyHotel/css/jquery-ui-1.8.14.custom.css" type="text/css" media="screen, projection">
<script src="http://localhost/RestEasyHotel/js/jquery-1.6.min.js" type="text/javascript" charset="utf-8"></script>
<script src="http://localhost/RestEasyHotel/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
   $(document).ready(function(){
		$('#login').click(function(){
			//alert("login clicked");
			var info = {
				'user' : $('#user').val(),
				'pass' : $('#pass').val()
			};
			$.ajax({
				url: '<?php echo base_url(); ?>index.php/staff/login',
				type: 'post',
				data: info,
				success: function(data){
					if(data==1){
						window.location = "<?php echo base_url();?>index.php/staff/reservation_list";
					}
					else{
						alert('Failed');
					}
					
				}
			});
		});

   });
</script>
</head>
<body style="position: relative; background-color:#CCCCCC; ">
<div align="center" style="width:300px; height:150px; position:absolute; margin-left:500px; margin-top:200px; padding-left:5px; padding-top:35px; background-image:url(http://localhost/RestEasyHotel/images/login_bg.png); background-repeat:no-repeat;">
    <form action="<?php echo base_url();?>index.php/staff/login" method="post">
    Username: <input type="text" id="user" name="user" /><br/>
    Password: <input type="password" id="pass" name="pass" /><br/>
    <input id="login" type="button" value="Login" />
    </form>
</div>
</body>
</html>